package com.zqxq.lottery.entity.o2o.esports;

import com.zqxq.common.utils.DispatcherUtils;
import com.zqxq.lottery.entity.po.esports.ESportsPO;
import com.zqxq.lottery.entity.vo.esports.ESportsVO;


public class ESportsO2O {

    public static ESportsVO toVO(ESportsPO po) {
        if (po == null) {
            return null;
        }
        ESportsVO eSportsVO = new ESportsVO();
        eSportsVO.setId(DispatcherUtils.parseString(po.getId()));
        eSportsVO.setMatchId(DispatcherUtils.parseString(po.getMatch_id()));
        eSportsVO.setType(DispatcherUtils.parseString(po.getType()));
        eSportsVO.setRound(DispatcherUtils.parseString(po.getRound()));
        eSportsVO.setLeftTeamLogo(po.getLeft_team_logo());
        eSportsVO.setRightTeamLogo(po.getRight_team_logo());
        eSportsVO.setLeftTeam(po.getLeft_team());
        eSportsVO.setRightTeam(po.getRight_team());
        eSportsVO.setLeftSupport(po.getLeft_support());
        eSportsVO.setRightSupport(po.getRight_support());
        eSportsVO.setStatus(DispatcherUtils.parseString(po.getStatus()));
        eSportsVO.setResult(String.valueOf(po.getResult()));
        eSportsVO.setMatchName(po.getMatch_name());
        eSportsVO.setScore(po.getScore());
        eSportsVO.setMatchTime(DispatcherUtils.parseDateTimeStr(po.getMatch_time()));
        eSportsVO.setCloseTime(DispatcherUtils.parseDateTimeStr(po.getClose_time()));
        eSportsVO.setCreateTime(DispatcherUtils.parseDateTimeStr(po.getCreate_time()));
        eSportsVO.setUpdateTime(DispatcherUtils.parseDateTimeStr(po.getUpdate_time()));
        eSportsVO.setBetStatus(DispatcherUtils.parseString(po.getBet_status()));
        return eSportsVO;
    }

    public static ESportsPO toPO(ESportsVO vo) {
        if (vo == null) {
            return null;
        }
        ESportsPO eSportsPO = new ESportsPO();
        eSportsPO.setId(DispatcherUtils.parseLong(vo.getId()));
        eSportsPO.setMatch_id(DispatcherUtils.parseLong(vo.getMatchId()));
        eSportsPO.setType(DispatcherUtils.parseInteger(vo.getType()));
        eSportsPO.setRound(DispatcherUtils.parseInteger(vo.getRound()));
        eSportsPO.setLeft_team_logo(vo.getLeftTeamLogo());
        eSportsPO.setRight_team_logo(vo.getRightTeamLogo());
        eSportsPO.setLeft_team(vo.getLeftTeam());
        eSportsPO.setRight_team(vo.getRightTeam());
        eSportsPO.setLeft_support(vo.getLeftSupport());
        eSportsPO.setRight_support(vo.getRightSupport());
        eSportsPO.setResult(Integer.valueOf(vo.getResult()));
        eSportsPO.setStatus(DispatcherUtils.parseInteger(vo.getStatus()));
        eSportsPO.setMatch_name(vo.getMatchName());
        eSportsPO.setScore(vo.getScore());
        eSportsPO.setMatch_time(DispatcherUtils.parseDateTime(vo.getMatchTime()));
        eSportsPO.setClose_time(DispatcherUtils.parseDateTime(vo.getCloseTime()));
        eSportsPO.setCreate_time(DispatcherUtils.parseDateTime(vo.getCreateTime()));
        eSportsPO.setUpdate_time(DispatcherUtils.parseDateTime(vo.getUpdateTime()));
        return eSportsPO;
    }
}
